﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Organizer.controls
{
    public partial class FeedbackMsg : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            divAlert.Visible = false;
            divError.Visible = false;
            divSucess.Visible = false;
            divWarning.Visible = false;
        }

        public void FeedBackMsg(string Text, int Type)
        {
            switch (Type)
            {
                case (int)AlertTypes.Alert:
                    divAlert.Visible = true;
                    lblAlert.Text = Text;
                    break;
                case (int)AlertTypes.Error:
                    divError.Visible = true;
                    lblError.Text = Text;
                    break;
                case (int)AlertTypes.Sucess:
                    divSucess.Visible = true;
                    lblSucess.Text = Text;
                    break;
                case (int)AlertTypes.Warning:
                    divWarning.Visible = true;
                    lblWarning.Text = Text;
                    break;
                default:
                    break;
            }
        }
    }

    public enum AlertTypes
    {
        Alert = 1,
        Error = 2,
        Sucess = 3,
        Warning = 4
    }
}